package com.cnsoft.persistent.player.U101112PlayerWeixin;

import org.cnsoft.framework.db.manager.MyDBTableSQLSupport;
import org.springframework.stereotype.Component;

/**
 * 会员微信用户信息建表语句
 */
@Component("U101112PlayerWeixinSQL")
//@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class U101112PlayerWeixinSQL extends MyDBTableSQLSupport {
	// 表名
	public String getTableName() {
		return "u101112_player_weixin";
	}

	// 获得SQL内容
	public String getSQL() throws Exception {
		StringBuilder sqlStringBuilder = new StringBuilder();// 临时变量

		sqlStringBuilder.append("CREATE TABLE u101112_player_weixin");
		sqlStringBuilder.append("(");
		sqlStringBuilder.append("    id VARCHAR(64) NOT NULL COMMENT '会员ID',");
		sqlStringBuilder.append("    wx_open_id VARCHAR(128) NOT NULL COMMENT '用户的标识',");
		sqlStringBuilder.append("    subscribe VARCHAR(4) DEFAULT '0' COMMENT '用户是否订阅该公众号标识',");
		sqlStringBuilder.append("    nick_name VARCHAR(80) NOT NULL COMMENT '昵称',");
		sqlStringBuilder.append("    sex VARCHAR(4) COMMENT '性别',");
		sqlStringBuilder.append("    city VARCHAR(20) COMMENT '用户所在城市',");
		sqlStringBuilder.append("    province VARCHAR(20) COMMENT '用户所在省份',");
		sqlStringBuilder.append("    country VARCHAR(80) COMMENT '用户所在国家',");
		sqlStringBuilder.append("    head_img_url VARCHAR(400) COMMENT '头像URL',");
		sqlStringBuilder.append("    subscribe_time VARCHAR(24) COMMENT '用户关注时间，为时间戳',");
		sqlStringBuilder.append("    unionid VARCHAR(128) COMMENT '微信唯一识别ID',");
		sqlStringBuilder.append("    remark VARCHAR(400) COMMENT '公众号运营者对粉丝的备注',");
		sqlStringBuilder.append("    memo VARCHAR(200) COMMENT '备注',");
		sqlStringBuilder.append("    fb1 VARCHAR(40) COMMENT '备用1',");
		sqlStringBuilder.append("    fb2 VARCHAR(20) COMMENT '备用2',");
		sqlStringBuilder.append("    fb3 VARCHAR(50) COMMENT '备用3',");
		sqlStringBuilder.append("    fb4 VARCHAR(200) COMMENT '备用4',");
		sqlStringBuilder.append("    fb5 VARCHAR(80) COMMENT '备用5',");
		sqlStringBuilder.append("    eb1 VARCHAR(40) COMMENT '扩展1',");
		sqlStringBuilder.append("    eb2 VARCHAR(80) COMMENT '扩展2',");
		sqlStringBuilder.append("    eb3 VARCHAR(20) COMMENT '扩展3',");
		sqlStringBuilder.append("    eb4 VARCHAR(10) COMMENT '扩展4',");
		sqlStringBuilder.append("    eb5 VARCHAR(20) COMMENT '扩展5',");
		sqlStringBuilder.append("    sid VARCHAR(20) COMMENT '数据归属系统',");
		sqlStringBuilder.append("    del_flag CHAR(1) DEFAULT '0' COMMENT '有效标识',");
		sqlStringBuilder.append("    create_time VARCHAR(24) DEFAULT '2018-02-02' NOT NULL COMMENT '创建时间',");
		sqlStringBuilder.append("    creator VARCHAR(64) DEFAULT 'SYSTEM' NOT NULL COMMENT '创建者',");
		sqlStringBuilder.append("    update_time VARCHAR(24) COMMENT '更新时间',");
		sqlStringBuilder.append("    updator VARCHAR(64) COMMENT '最后更新者',");
		sqlStringBuilder.append("  PRIMARY KEY (id)");
		sqlStringBuilder.append(") COMMENT '会员微信用户信息';");

		return sqlStringBuilder.toString();
	}

}
